home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / DEMO_VGA / FRSTM1.LZH / ATILINE.ASM < prev    next >
Assembly Source File  |  1989-03-26  |  1KB  |  71 lines

  1. _TEXT SEGMENT BYTE PUBLIC 'CODE'
  2. ASSUME CS:_TEXT
  3.  
  4. ; void far ATIxorHorLine(int x, int y, int Increment, int Length)
  5. x           equ      WORD PTR [bp + 6]
  6. y           equ      WORD PTR [bp + 8]
  7. Increment   equ      WORD PTR [bp + 10]
  8. Length      equ      WORD PTR [bp + 12]
  9. BPL         equ      WORD PTR [bp + 14]
  10.  
  11. ; Local variables
  12. Plane       equ      WORD PTR [bp - 2]
  13. LastLocal   equ      2
  14.  
  15. extrn _SetATIPlane:FAR, _LineColor:BYTE
  16.  
  17. PUBLIC _ATIxorLine
  18. _ATIxorLine       PROC     FAR
  19.       push  bp
  20.       mov   bp, sp
  21.       sub   sp, LastLocal
  22.       push  es
  23.       push  di
  24.       mov   ax, y
  25.       mov   bx, BPL
  26.       mul   bx
  27.       add   ax, x
  28.       adc   dx, 0
  29.       push  ax
  30.       mov   Plane, dx
  31.       push  dx
  32.       call  _SetATIPlane
  33.       pop   dx
  34.       pop   di
  35.       mov   ax, 0a000h
  36.       mov   es, ax
  37.       mov   al, _LineColor
  38.       mov   cx, Length
  39.  
  40. NextPixel:
  41.       xor   es:[di], al
  42.       add   di, Increment
  43.       jnc   CheckLoop
  44.       inc   Plane
  45.       push  ax
  46.       push  di
  47.       push  es
  48.       push  cx
  49.       push  Plane
  50.       call  _SetATIPlane
  51.       pop   Plane
  52.       pop   cx
  53.       pop   es
  54.       pop   di
  55.       pop   ax
  56.  
  57. CheckLoop:
  58.       loop  NextPixel
  59.  
  60.       pop   di
  61.       pop   es
  62.       mov   sp, bp
  63.       pop   bp
  64.       ret
  65. _ATIxorLine  ENDP
  66.  
  67. _TEXT    ENDS
  68.  
  69. END
  70.  
  71.